home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / mapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  11.7 KB  |  373 lines

  1. /*
  2.  *  M A P I . H
  3.  *
  4.  *  Messaging Applications Programming Interface.
  5.  *
  6.  *  Copyright 1986-1996 Microsoft Corporation. All Rights Reserved.
  7.  *
  8.  *  Purpose:
  9.  *
  10.  *    This file defines the structures and constants used by that
  11.  *    subset of the Messaging Applications Programming Interface
  12.  *    which is supported under Windows by Microsoft Mail for PC
  13.  *    Networks version 3.x.
  14.  */
  15.  
  16.  
  17. #ifndef MAPI_H
  18. #define MAPI_H
  19. #pragma option push -b
  20.  
  21.  
  22. /*
  23.  *  Types.
  24.  */
  25.  
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30.  
  31.  
  32. #ifndef EXPORT
  33. #ifdef WIN16
  34. #define EXPORT __export
  35. #else
  36. /* Additional special definitions here */
  37. #define EXPORT
  38. #endif
  39. #endif
  40.  
  41. typedef unsigned long FAR * LPULONG;
  42. typedef unsigned long       FLAGS;
  43.  
  44. #ifndef __LHANDLE
  45. #define __LHANDLE
  46. typedef unsigned long       LHANDLE, FAR * LPLHANDLE;
  47. #endif
  48.  
  49. typedef unsigned char FAR * LPBYTE;
  50.  
  51. #define    lhSessionNull    ((LHANDLE)0)
  52.  
  53. #if defined (__BORLANDC__)
  54. #  include <pshpack8.h>
  55. #endif
  56.  
  57. typedef struct
  58. {
  59.     ULONG ulReserved;            /* Reserved for future use (must be 0)     */
  60.     ULONG flFlags;               /* Flags                                   */
  61.     ULONG nPosition;             /* character in text to be replaced by attachment */
  62.     LPSTR lpszPathName;          /* Full path name of attachment file       */
  63.     LPSTR lpszFileName;          /* Original file name (optional)           */
  64.     LPVOID lpFileType;           /* Attachment file type (can be lpMapiFileTagExt) */
  65. } MapiFileDesc, FAR * lpMapiFileDesc;
  66.  
  67. #define MAPI_OLE                0x00000001
  68. #define MAPI_OLE_STATIC         0x00000002
  69.  
  70.  
  71. typedef struct
  72. {
  73.     ULONG ulReserved;           /* Reserved, must be zero.                  */
  74.     ULONG cbTag;                /* Size (in bytes) of                       */
  75.     LPBYTE lpTag;               /* X.400 OID for this attachment type       */
  76.     ULONG cbEncoding;           /* Size (in bytes) of                       */
  77.     LPBYTE lpEncoding;          /* X.400 OID for this attachment's encoding */
  78. } MapiFileTagExt, FAR *lpMapiFileTagExt;
  79.  
  80.  
  81. typedef struct
  82. {
  83.     ULONG ulReserved;           /* Reserved for future use                  */
  84.     ULONG ulRecipClass;         /* Recipient class                          */
  85.                                 /* MAPI_TO, MAPI_CC, MAPI_BCC, MAPI_ORIG    */
  86.     LPSTR lpszName;             /* Recipient name                           */
  87.     LPSTR lpszAddress;          /* Recipient address (optional)             */
  88.     ULONG ulEIDSize;            /* Count in bytes of size of pEntryID       */
  89.     LPVOID lpEntryID;           /* System-specific recipient reference      */
  90. } MapiRecipDesc, FAR * lpMapiRecipDesc;
  91.  
  92. #ifndef MAPI_ORIG               /* also defined in mapix.h */
  93. #define MAPI_ORIG   0           /* Recipient is message originator          */
  94. #define MAPI_TO     1           /* Recipient is a primary recipient         */
  95. #define MAPI_CC     2           /* Recipient is a copy recipient            */
  96. #define MAPI_BCC    3           /* Recipient is blind copy recipient        */
  97. #endif
  98.  
  99. typedef struct
  100. {
  101.     ULONG ulReserved;             /* Reserved for future use (M.B. 0)       */
  102.     LPSTR lpszSubject;            /* Message Subject                        */
  103.     LPSTR lpszNoteText;           /* Message Text                           */
  104.     LPSTR lpszMessageType;        /* Message Class                          */
  105.     LPSTR lpszDateReceived;       /* in YYYY/MM/DD HH:MM format             */
  106.     LPSTR lpszConversationID;     /* conversation thread ID                 */
  107.     FLAGS flFlags;                /* unread,return receipt                  */
  108.     lpMapiRecipDesc lpOriginator; /* Originator descriptor                  */
  109.     ULONG nRecipCount;            /* Number of recipients                   */
  110.     lpMapiRecipDesc lpRecips;     /* Recipient descriptors                  */
  111.     ULONG nFileCount;             /* # of file attachments                  */
  112.     lpMapiFileDesc lpFiles;       /* Attachment descriptors                 */
  113. } MapiMessage, FAR * lpMapiMessage;
  114.  
  115. #define MAPI_UNREAD             0x00000001
  116. #define MAPI_RECEIPT_REQUESTED  0x00000002
  117. #define MAPI_SENT               0x00000004
  118.  
  119. #if defined (__BORLANDC__)
  120. #  include <poppack.h>
  121. #endif
  122.  
  123. /*
  124.  *  Entry points.
  125.  */
  126.  
  127. /*
  128.  *  flFlags values for Simple MAPI entry points. All documented flags are
  129.  *  shown for each call. Duplicates are commented out but remain present
  130.  *  for every call.
  131.  */
  132.  
  133. /* MAPILogon() flags.       */
  134.  
  135. #define MAPI_LOGON_UI           0x00000001  /* Display logon UI             */
  136. #ifndef MAPI_PASSWORD_UI
  137. #define MAPI_PASSWORD_UI        0x00020000  /* prompt for password only     */
  138. #endif
  139. #define MAPI_NEW_SESSION        0x00000002  /* Don't use shared session     */
  140. #define MAPI_FORCE_DOWNLOAD     0x00001000  /* Get new mail before return   */
  141. #define MAPI_EXTENDED           0x00000020  /* Extended MAPI Logon          */
  142.  
  143. /* MAPISendMail() flags.    */
  144.  
  145. /* #define MAPI_LOGON_UI        0x00000001     Display logon UI             */
  146. /* #define MAPI_NEW_SESSION     0x00000002     Don't use shared session     */
  147.  
  148. #ifndef MAPI_DIALOG             /* also defined in property.h */
  149. #define MAPI_DIALOG             0x00000008  /* Display a send note UI       */
  150. #endif
  151. /*# define MAPI_USE_DEFAULT     0x00000040     Use default profile in logon */
  152.  
  153. /* MAPIFindNext() flags.    */
  154.  
  155. #define MAPI_UNREAD_ONLY        0x00000020  /* Only unread messages         */
  156. #define MAPI_GUARANTEE_FIFO     0x00000100  /* use date order               */
  157. #define MAPI_LONG_MSGID         0x00004000  /* allow 512 char returned ID   */
  158.  
  159. /* MAPIReadMail() flags.    */
  160.  
  161. #define MAPI_PEEK               0x00000080  /* Do not mark as read.         */
  162. #define MAPI_SUPPRESS_ATTACH    0x00000800  /* header + body, no files      */
  163. #define MAPI_ENVELOPE_ONLY      0x00000040  /* Only header information      */
  164. #define MAPI_BODY_AS_FILE       0x00000200
  165.  
  166. /* MAPISaveMail() flags.    */
  167.  
  168. /* #define MAPI_LOGON_UI        0x00000001     Display logon UI             */
  169. /* #define MAPI_NEW_SESSION     0x00000002     Don't use shared session     */
  170. /* #define MAPI_LONG_MSGID      0x00004000  /* allow 512 char returned ID   */
  171.  
  172. /* MAPIAddress() flags.     */
  173.  
  174. /* #define MAPI_LOGON_UI        0x00000001     Display logon UI             */
  175. /* #define MAPI_NEW_SESSION     0x00000002     Don't use shared session     */
  176.  
  177. /* MAPIDetails() flags.     */
  178.  
  179. /* #define MAPI_LOGON_UI        0x00000001     Display logon UI             */
  180. /* #define MAPI_NEW_SESSION     0x00000002     Don't use shared session     */
  181. #define MAPI_AB_NOMODIFY        0x00000400  /* Don't allow mods of AB entries */
  182.  
  183. /* MAPIResolveName() flags. */
  184.  
  185. /* #define MAPI_LOGON_UI        0x00000001     Display logon UI             */
  186. /* #define MAPI_NEW_SESSION     0x00000002     Don't use shared session     */
  187. /* #define MAPI_DIALOG          0x00000008     Prompt for choices if ambiguous */
  188. /* #define MAPI_AB_NOMODIFY     0x00000400     Don't allow mods of AB entries */
  189.  
  190. typedef ULONG (FAR PASCAL MAPILOGON)(
  191.     ULONG ulUIParam,
  192.     LPSTR lpszProfileName,
  193.     LPSTR lpszPassword,
  194.     FLAGS flFlags,
  195.     ULONG ulReserved,
  196.     LPLHANDLE lplhSession
  197. );
  198. typedef MAPILOGON FAR *LPMAPILOGON;
  199. MAPILOGON MAPILogon;
  200.  
  201. typedef ULONG (FAR PASCAL MAPILOGOFF)(
  202.     LHANDLE lhSession,
  203.     ULONG ulUIParam,
  204.     FLAGS flFlags,
  205.     ULONG ulReserved
  206. );
  207. typedef MAPILOGOFF FAR *LPMAPILOGOFF;
  208. MAPILOGOFF MAPILogoff;
  209.  
  210.  
  211. typedef ULONG (FAR PASCAL MAPISENDMAIL)(
  212.     LHANDLE lhSession,
  213.     ULONG ulUIParam,
  214.     lpMapiMessage lpMessage,
  215.     FLAGS flFlags,
  216.     ULONG ulReserved
  217. );
  218. typedef MAPISENDMAIL FAR *LPMAPISENDMAIL;
  219. MAPISENDMAIL MAPISendMail;
  220.  
  221.  
  222. typedef ULONG (FAR PASCAL MAPISENDDOCUMENTS)(
  223.     ULONG ulUIParam,
  224.     LPSTR lpszDelimChar,
  225.     LPSTR lpszFilePaths,
  226.     LPSTR lpszFileNames,
  227.     ULONG ulReserved
  228. );
  229. typedef MAPISENDDOCUMENTS FAR *LPMAPISENDDOCUMENTS;
  230. MAPISENDDOCUMENTS MAPISendDocuments;
  231.  
  232.  
  233. typedef ULONG (FAR PASCAL MAPIFINDNEXT)(
  234.     LHANDLE lhSession,
  235.     ULONG ulUIParam,
  236.     LPSTR lpszMessageType,
  237.     LPSTR lpszSeedMessageID,
  238.     FLAGS flFlags,
  239.     ULONG ulReserved,
  240.     LPSTR lpszMessageID
  241. );
  242. typedef MAPIFINDNEXT FAR *LPMAPIFINDNEXT;
  243. MAPIFINDNEXT MAPIFindNext;
  244.  
  245. typedef ULONG (FAR PASCAL MAPIREADMAIL)(
  246.     LHANDLE lhSession,
  247.     ULONG ulUIParam,
  248.     LPSTR lpszMessageID,
  249.     FLAGS flFlags,
  250.     ULONG ulReserved,
  251.     lpMapiMessage FAR *lppMessage
  252. );
  253. typedef MAPIREADMAIL FAR *LPMAPIREADMAIL;
  254. MAPIREADMAIL MAPIReadMail;
  255.  
  256. typedef ULONG (FAR PASCAL MAPISAVEMAIL)(
  257.     LHANDLE lhSession,
  258.     ULONG ulUIParam,
  259.     lpMapiMessage lpMessage,
  260.     FLAGS flFlags,
  261.     ULONG ulReserved,
  262.     LPSTR lpszMessageID
  263. );
  264. typedef MAPISAVEMAIL FAR *LPMAPISAVEMAIL;
  265. MAPISAVEMAIL MAPISaveMail;
  266.  
  267. typedef ULONG (FAR PASCAL MAPIDELETEMAIL)(
  268.     LHANDLE lhSession,
  269.     ULONG ulUIParam,
  270.     LPSTR lpszMessageID,
  271.     FLAGS flFlags,
  272.     ULONG ulReserved
  273. );
  274. typedef MAPIDELETEMAIL FAR *LPMAPIDELETEMAIL;
  275. MAPIDELETEMAIL MAPIDeleteMail;
  276.  
  277. #ifndef _MAC
  278. typedef ULONG (EXPORT FAR PASCAL MAPIFREEBUFFER)(
  279.     LPVOID pv
  280. );
  281. typedef MAPIFREEBUFFER FAR *LPMAPIFREEBUFFER;
  282. MAPIFREEBUFFER MAPIFreeBuffer;
  283. #endif
  284.  
  285. typedef ULONG (FAR PASCAL MAPIADDRESS)(
  286.     LHANDLE lhSession,
  287.     ULONG ulUIParam,
  288.     LPSTR lpszCaption,
  289.     ULONG nEditFields,
  290.     LPSTR lpszLabels,
  291.     ULONG nRecips,
  292.     lpMapiRecipDesc lpRecips,
  293.     FLAGS flFlags,
  294.     ULONG ulReserved,
  295.     LPULONG lpnNewRecips,
  296.     lpMapiRecipDesc FAR *lppNewRecips
  297. );
  298. typedef MAPIADDRESS FAR *LPMAPIADDRESS;
  299. MAPIADDRESS MAPIAddress;
  300.  
  301. typedef ULONG (FAR PASCAL MAPIDETAILS)(
  302.     LHANDLE lhSession,
  303.     ULONG ulUIParam,
  304.     lpMapiRecipDesc lpRecip,
  305.     FLAGS flFlags,
  306.     ULONG ulReserved
  307. );
  308. typedef MAPIDETAILS FAR *LPMAPIDETAILS;
  309. MAPIDETAILS MAPIDetails;
  310.  
  311. typedef ULONG (FAR PASCAL MAPIRESOLVENAME)(
  312.     LHANDLE lhSession,
  313.     ULONG ulUIParam,
  314.     LPSTR lpszName,
  315.     FLAGS flFlags,
  316.     ULONG ulReserved,
  317.     lpMapiRecipDesc FAR *lppRecip
  318. );
  319. typedef MAPIRESOLVENAME FAR *LPMAPIRESOLVENAME;
  320. MAPIRESOLVENAME MAPIResolveName;
  321.  
  322. #ifndef SUCCESS_SUCCESS
  323. #define SUCCESS_SUCCESS                 0
  324. #endif
  325. #define MAPI_USER_ABORT                 1
  326. #define MAPI_E_USER_ABORT               MAPI_USER_ABORT
  327. #define MAPI_E_FAILURE                  2
  328. #define MAPI_E_LOGON_FAILURE            3
  329. #define MAPI_E_LOGIN_FAILURE            MAPI_E_LOGON_FAILURE
  330. #define MAPI_E_DISK_FULL                4
  331. #define MAPI_E_INSUFFICIENT_MEMORY      5
  332. #define MAPI_E_ACCESS_DENIED            6
  333. #define MAPI_E_TOO_MANY_SESSIONS        8
  334. #define MAPI_E_TOO_MANY_FILES           9
  335. #define MAPI_E_TOO_MANY_RECIPIENTS      10
  336. #define MAPI_E_ATTACHMENT_NOT_FOUND     11
  337. #define MAPI_E_ATTACHMENT_OPEN_FAILURE  12
  338. #define MAPI_E_ATTACHMENT_WRITE_FAILURE 13
  339. #define MAPI_E_UNKNOWN_RECIPIENT        14
  340. #define MAPI_E_BAD_RECIPTYPE            15
  341. #define MAPI_E_NO_MESSAGES              16
  342. #define MAPI_E_INVALID_MESSAGE          17
  343. #define MAPI_E_TEXT_TOO_LARGE           18
  344. #define MAPI_E_INVALID_SESSION          19
  345. #define MAPI_E_TYPE_NOT_SUPPORTED       20
  346. #define MAPI_E_AMBIGUOUS_RECIPIENT      21
  347. #define MAPI_E_AMBIG_RECIP              MAPI_E_AMBIGUOUS_RECIPIENT
  348. #define MAPI_E_MESSAGE_IN_USE           22
  349. #define MAPI_E_NETWORK_FAILURE          23
  350. #define MAPI_E_INVALID_EDITFIELDS       24
  351. #define MAPI_E_INVALID_RECIPS           25
  352. #define MAPI_E_NOT_SUPPORTED            26
  353.  
  354.  
  355.  
  356. #ifdef MAPIX_H
  357. /*  Maps from a simple mapi session to a MAPI 1.0 extended mapi session */
  358.  
  359. STDMETHODIMP_(SCODE)
  360. ScMAPIXFromSMAPI(LHANDLE lhSimpleSession,
  361.                 ULONG ulFlags,
  362.                 LPCIID lpInterface,
  363.                 LPMAPISESSION FAR * lppMAPISession);
  364. #endif /* MAPIX_H */
  365.  
  366.  
  367. #ifdef  __cplusplus
  368. }       /*  extern "C" */
  369. #endif
  370.  
  371. #pragma option pop
  372. #endif /* MAPI_H */
  373.